<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/jquery-weui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/index.css" />
		<link rel="stylesheet" type="text/css" href="../../css/mine.css" />
		<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_546019_o8qxm6fupb0ggb9.css" />
		<title>过磅列表</title>
		<script src="../../js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/baseConfig.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<!--<div id="header">
			<div class="header-title" style="position: fixed;top: 0;">
				<img src="../../img/left.png" class="left" />
				<span>过磅列表</span>
			</div>
		</div>-->
		<div class="mine-content" style="margin-bottom: 0;margin-top: 0;">
			<div class="company-name">
				<span class='orderNumber'></span>
			</div>
			<div class="tlg">

			</div>

			<!--过磅列表 -->
			<ul class="ponderList">
				
				<!--<li>
					<p>
						<em>津A12345</em>
						<img src="../../img/right.png" />
					</p>
					<p>
						<span>司机姓名</span>
						<b>张三三</b>
					</p>
					<p>
						<span>装车重量</span>
						<b>30.12 <em>吨</em></b>
					</p>
					<p>
						<span>司机电话</span>
						<b>13277896547</b>
					</p>
					<p>
						<span>司机身份证</span>
						<b>430201******0715</b>
					</p>
					<p>
						<span>2017/06/28  16:45:48</span>
					</p>
					<p>
						<i>可出场</i>
					</p>
				</li>-->
			
			</ul>
		</div>

	</body>
	<script type="text/javascript">
		$(document).ready(function(){
			baseConfig.historyBack()
			$.showLoading("加载中...");
			var fn = {};
			fn.enter = function(num2){
				if(num2==0){
					return "未入场"
				}
				if(num2==1){
					return "已入场"
				}
				if(num2==2){
					return "可出场"
				}
				if(num2==3){
					return "已出场"
				}
			}
			fn.showNull = function(str){
				if(!str || str==null){
					return ""
				}else{
					return str
				}
			}
			$.ajax({
					type: "get",
					url: baseConfig.localHttp+"weChatApi/fgclient/getPoundList",
					async: false,
					headers: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					data: {
						clientId: baseConfig.login(),
						orderNo:baseConfig.GetQueryString("orderNo")
					},
					success: function(data) {
						$.hideLoading();
						console.log(data)
						var status = baseConfig.GetQueryString("status")
						if(data.code==100){
							var content = data.content
							$(".orderNumber").html(baseConfig.GetQueryString("orderNo"))
							var $li=""
							for(var i=0;i<content.length;i++){
								$li += "<li carId="+content[i].carId+" orderType="+content[i].orderType+" carNo="+content[i].carNo+" data-status="+content[i].isPoundOrderConfirm+" orderNo="+content[i].orderNo+"><p><em>"+content[i].carNo+"</em><img src='../../img/right.png' /></p><p><span>司机姓名</span><b>"+fn.showNull(content[i].driver)+"</b></p><p><span>装车重量</span><b>"+fn.showNull(content[i].weight)+"<em>吨</em></b></p><p><span>司机电话</span><b>"+content[i].phone+"</b></p><p><span>司机身份证</span><b>"+fn.showNull(content[i].idCard)+"</b></p><p><span>入场时间</span><b>"+content[i].uploadTime.slice(0,19)+"</b></p>"
								$li += "<p><i enter="+content[i].enterStatus+" class='enter' style='color:"+baseConfig.colorTrans(content[i].enterStatus)+";border-color:"+baseConfig.colorTrans(content[i].enterStatus)+"'></i></p></li>"
							}
							$(".ponderList").append($li);
							for(var j=0;j<$(".ponderList li").length;j++){
									$(".ponderList li").eq(j).find(".enter").html(fn.enter($(".ponderList li").eq(j).find(".enter").attr("enter")))
									$(".ponderList li").eq(j).on("click",function(){
										var a = $(this).attr("carNo");
										var b = $(this).attr("orderNo");
										var c = $(this).attr("data-status")
										var d = $(this).attr("orderType")
										var e = $(this).attr("carId")
										var f = $(this).find(".enter").attr("enter")
										if(status==1&&d==1){
											location.href = "ponderationInformation.html?carNo="+a+"&orderNo="+b+"&status=1&dataStatus="+c+"&enterStatus="+f
										}else if(status==1&&d==2){
											location.href = "mutongponderInformation.html?carId="+e+"&enterStatus="+f
										}else if(status==2&&d==1){
											location.href = "ponderationInformation.html?carNo="+a+"&orderNo="+b+"&status=2&dataStatus="+c+"&enterStatus="+f
										}else{
											location.href = "mutongponderInformation.html?carId="+e+"&enterStatus="+f
										}
									})						
							}
						}else{
							$.toptip(data.content, 1200, 'error');
						}					
					},
					error:function(){
						$.hideLoading();
						$.toast("请求失败", "cancel");
					}
				})	
				//添加运输车
		})
	</script>
</html>